<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>CRM管理系统</title>
    <link rel="stylesheet" href="__PUBLIC__/Common/css/index.css">
</head>
<body>

<div class="login-page">
    <div class="logo">CRM管理系统</div>
    <form id="loginform" method="post" action="/home/index/doLogin">
        <div class="login-box">
            <div class="login-form">
                <div class="ipt-item">
                    <input type="text" name="account" placeholder="请输入账号"/>
                </div>
                <div class="ipt-item">
                    <input type="password" name="password" placeholder="请输入密码"/>
                </div>
            </div>
            <div class="action">
                <button class="btn-login" type="button" id="btnsubmit">登录</button>
            </div>
            <div class="login-error"><?php echo isset($errMessage) != null ? $errMessage : '' ?></div>
        </div>
    </form>
</div>
<script src="__PUBLIC__/Common/js/jquery-1.11.1.min.js"></script>
<script>
    $(document).ready(function () {
        $("#btnsubmit").click(function () {
            $.post($("#loginform").attr("action"), $("#loginform").serialize(), function (data) {
                if (data == "1") {
                    window.location.href = "/home/home/index";
                } else {
                    $(".login-error").html("账号或密码错误");
                }
            });
        })
    })
</script>
</body>
</html>